package com.example.kingdee.controller;


import com.example.kingdee.common.AjaxResult;
import com.example.kingdee.common.StringUtils;
import com.example.kingdee.kingdeeBridge.dto.BillWriteInDto;
import com.example.kingdee.kingdeeBridge.dto.PaperDto;
import com.example.kingdee.service.PaperCalculateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 核价系统
 */
@RestController
@RequestMapping("//paperCalculate")
public class PaperCalculateController {

    @Autowired
    private PaperCalculateService paperCalculateService;

    //计算纸张拼版规格
    @PostMapping("/sheetSize")
    public AjaxResult sheetSize(@RequestBody PaperDto paperDto){
        List<Map<String, Object>> result = paperCalculateService.sheetSize(paperDto);
        if (StringUtils.isNull(result)) {
            result = new ArrayList<>();
        }
        return AjaxResult.success(result);
    }
}
